package com.wx.gof.pattern.structural.proxy.staticproxy;

import com.wx.gof.pattern.structural.proxy.Jay;

/**
 * @ClassName JayStaticProxy
 * @Author wx
 * @Description 周杰伦静态代理
 * @Date 2018-12-11-22:38
 */
public class JayStaticProxy {
    private Jay jay;

    public JayStaticProxy(Jay jay) {
        this.jay = jay;
    }
    
    /**
     * @methodName: work
     * @author: wx
     * @description: 代理周杰伦工作行为
     * @param
     * @date: 2018/12/11
     * @return: void
     */
    public void work() {
        beforeMethod();
        jay.work();
        afterMethod();
    }

    /**
     * @param
     * @methodName: beforeMethod
     * @author: wx
     * @description: 前置通知-前置增强
     * @date: 2018/12/11
     * @return: void
     */
    private void beforeMethod() {
        System.out.println("调整状态");
    }

    /**
     * @param
     * @methodName: afterMethod
     * @author: wx
     * @description: 后置通知
     * @date: 2018/12/11
     * @return: void
     */
    private void afterMethod() {
        System.out.println("休息一会");
    }
}
